﻿using System.Collections.Generic;

namespace MLSharp.Utilities
{
	/// <summary>
	/// Contains extension methods for <see cref="HashSet{T}"/>.
	/// </summary>
	public static class HashSetExtensions
	{
		/// <summary>
		/// Adds a range of values to the specified HashSet.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="hashSet"></param>
		/// <param name="values"></param>
		public static void AddRange<T>(this HashSet<T> hashSet, IEnumerable<T> values)
		{
			foreach (T value in values)
			{
				hashSet.Add(value);
			}
		}
	}
}
